const fs = require('fs')

const file = {
    mkdir: dir => {
        return new Promise((resolve) => {
            fs.exists(dir, function(exist) {
                if (exist) {
                    resolve(dir)
                    return
                }
                fs.mkdir(dir, function(e) {
                    if (!e){
                        resolve(dir)
                    }
                })
            })
        })
    }
}

module.exports = file